;$(function () {
  $(".join").on("click", function (e) {
    e.preventDefault();
    let cartObj ={
      uid:JSON.parse(localStorage.getItem("userinfo"))[0].u_id,
      cname:$(".slog").text(),
      cprice:$(".jg").text(),
      cnum:$(".lzj").val(),
      ctotal:$(".pay").text(),
      cimg:$(".smllimg").find("img").attr("src"),
    };
    console.log(cartObj)
    $.ajax({
      url:"/cart/add",
      type:"post",
      data:cartObj
    }).then(function (res) {
        layer.msg(res.msg)
    })
  })

})